﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace weba
{
    public partial class addwd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            dituwz d = new dituwz();
            d.Id=mk.l.dituwz.Count()+1;
            d.name = this.name.Text.ToString();
            d.shuoming = this.jiesao.Text.ToString();
            d.address = this.dizhi.Text.ToString();
            d.tel = this.dianh.Text.ToString();
            d.pid = int.Parse(this.C1ComboBox1.SelectedItem.Value.ToString());
            string pt = FileUpload1.FileName;
            string location1 = Server.MapPath("Images/") + pt;
            FileUpload1.SaveAs(location1);
            d.tupianurl = pt;
            mk.l.dituwz.InsertOnSubmit(d);
            mk.l.SubmitChanges();
            mk.Alert("添加成功，青岛编辑页面查看");
        }
    }
}